
package jz.service.baseData;

import java.util.Date;
import java.util.UUID;

import SoftFan.util.textUnit;

public class ProviderData {

	public static final int		REGISTER		= 1;
	public static final int		BODYCALL		= 2;
	public static final int		BODYPASS		= 3;
	public static final int		ASSAYCALL		= 4;
	public static final int		ASSAYPASS		= 5;
	public static final int		ALLOTPASS		= 6;
	public static final int		COLLECTSTART	= 7;
	public static final int		COLLECTING		= 8;
	public static final int		COLLECTFINISH	= 9;

	private String				regId;

	private String				code;
	private java.lang.String	sfz;
	private java.lang.String	xm;
	private java.lang.String	sex;

	private String				regCode;

	private Date				registerTime;
	private Date				bodyCall;
	private Date				bodyPassTime;
	private boolean				bodyIsPass;
	private boolean				needAssay;
	private Date				assayCall;
	private Date				assayPassTime;
	private boolean				assayIsPass;
	private boolean				allotCall;
	private Date				allotTime;
	private Date				collectStartTime;
	private Date				collectFinishTime;

	private String				machineCode;

	private boolean				needXqdy;
	private String				xqdyId;

	private int					idx;

	private int					zwVer;

	public ProviderData() {
		regId = UUID.randomUUID().toString();
	}

	public ProviderData selfCopy() {
		ProviderData newdata = new ProviderData();

		newdata.setCode(code);
		newdata.setSfz(sfz);
		newdata.setXm(xm);
		newdata.setXm(sex);

		newdata.setRegisterTime(registerTime);
		newdata.setBodyCall(bodyCall);
		newdata.setBodyPassTime(bodyPassTime);
		newdata.setBodyIsPass(bodyIsPass);
		newdata.setAssayCall(assayCall);
		newdata.setAssayPassTime(assayPassTime);
		newdata.setAssayIsPass(assayIsPass);
		newdata.setNeedAssay(needAssay);
		newdata.setAllotCall(allotCall);
		newdata.setAllotTime(allotTime);
		newdata.setCollectStartTime(collectStartTime);
		newdata.setCollectFinishTime(collectFinishTime);

		newdata.setIdx(idx);
		newdata.setRegCode(regCode);
		newdata.setMachineCode(machineCode);

		newdata.setNeedXqdy(needXqdy);
		newdata.setXqdyId(xqdyId);

		newdata.setZwVer(zwVer);

		return newdata;
	}

	public int getStatus() {
		if (collectFinishTime != null) {
			return COLLECTFINISH;
		}
		if (collectStartTime != null) {
			return COLLECTSTART;
		}
		if (!textUnit.StringIsEmpty(machineCode)) {
			return ALLOTPASS;
		}
		if (assayPassTime != null) {
			return ASSAYPASS;
		}
		if (assayCall != null) {
			return ASSAYCALL;
		}
		if (bodyPassTime != null) {
			return BODYPASS;
		}
		if (bodyCall != null) {
			return BODYCALL;
		}
		return REGISTER;
	}

	public String getRegId() {
		return regId;
	}

	public void setRegId(String regId) {
		this.regId = regId;
	}

	public int getIdx() {
		return idx;
	}

	public void setIdx(int idx) {
		this.idx = idx;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String card) {
		this.code = card;
	}

	public java.lang.String getSfz() {
		return sfz;
	}

	public void setSfz(java.lang.String sfz) {
		this.sfz = sfz;
	}

	public java.lang.String getXm() {
		return xm;
	}

	public void setXm(java.lang.String xm) {
		this.xm = xm;
	}

	public java.lang.String getSex() {
		return sex;
	}

	public void setSex(java.lang.String sex) {
		this.sex = sex;
	}

	public Date getBodyCall() {
		return bodyCall;
	}

	public void setBodyCall(Date bodyCall) {
		this.bodyCall = bodyCall;
	}

	public boolean isBodyIsPass() {
		return bodyIsPass;
	}

	public void setBodyIsPass(boolean bodyIsPass) {
		this.bodyIsPass = bodyIsPass;
	}

	public Date getAssayCall() {
		return assayCall;
	}

	public void setAssayCall(Date assayCall) {
		this.assayCall = assayCall;
	}

	public boolean isAssayIsPass() {
		return assayIsPass;
	}

	public void setAssayIsPass(boolean assayPass) {
		this.assayIsPass = assayPass;
	}

	public String getRegCode() {
		return regCode;
	}

	public void setRegCode(String regCode) {
		this.regCode = regCode;
	}

	public String getMachineCode() {
		return machineCode;
	}

	public void setMachineCode(String machineCode) {
		this.machineCode = machineCode;
	}

	public boolean isAllotCall() {
		return allotCall;
	}

	public void setAllotCall(boolean allotCall) {
		this.allotCall = allotCall;
	}

	public Date getAllotTime() {
		return allotTime;
	}

	public void setAllotTime(Date allotTime) {
		this.allotTime = allotTime;
	}

	public Date getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	public Date getBodyPassTime() {
		return bodyPassTime;
	}

	public void setBodyPassTime(Date bodyPassTime) {
		this.bodyPassTime = bodyPassTime;
	}

	public boolean isNeedAssay() {
		return needAssay;
	}

	public void setNeedAssay(boolean hasAssay) {
		this.needAssay = hasAssay;
	}

	public Date getAssayPassTime() {
		return assayPassTime;
	}

	public void setAssayPassTime(Date assayPassTime) {
		this.assayPassTime = assayPassTime;
	}

	public Date getCollectStartTime() {
		return collectStartTime;
	}

	public void setCollectStartTime(Date collectStartTime) {
		this.collectStartTime = collectStartTime;
	}

	public Date getCollectFinishTime() {
		return collectFinishTime;
	}

	public void setCollectFinishTime(Date collectFinishTime) {
		this.collectFinishTime = collectFinishTime;
	}

	public boolean isNeedXqdy() {
		return needXqdy;
	}

	public void setNeedXqdy(boolean needXqdy) {
		this.needXqdy = needXqdy;
	}

	public String getXqdyId() {
		return xqdyId;
	}

	public void setXqdyId(String xqdyId) {
		this.xqdyId = xqdyId;
	}

	public int getZwVer() {
		return zwVer;
	}

	public void setZwVer(int zwVer) {
		this.zwVer = zwVer;
	}

	public void copyToOther(ProviderData other) {
		other.setSfz(sfz);
		other.setXm(xm);
		other.setSex(sex);

		other.setRegisterTime(registerTime);
		other.setBodyCall(bodyCall);
		other.setBodyPassTime(bodyPassTime);
		other.setBodyIsPass(bodyIsPass);
		other.setAssayCall(assayCall);
		other.setAssayPassTime(assayPassTime);
		other.setAssayIsPass(assayIsPass);
		other.setNeedAssay(needAssay);
		other.setAllotCall(allotCall);
		other.setAllotTime(allotTime);
		other.setCollectStartTime(collectStartTime);
		other.setCollectFinishTime(collectFinishTime);

		other.setIdx(idx);
		other.setRegCode(regCode);
		other.setMachineCode(machineCode);

		other.setNeedXqdy(needXqdy);
		other.setXqdyId(xqdyId);

		other.setZwVer(zwVer);
	}
}
